package com.mmall.common;/**
 * Created by 果果 on 2017/8/4.
 */


import com.google.common.collect.Sets;
import org.apache.commons.lang3.StringUtils;

import java.util.Set;

/**
 * @author 果果
 * @描述 系统常量类
 * @create 2017-08-04 15:23
 **/
public class Const {
    //当前用户
    public  static  final String CURRENT_USER="currentUser";
    //用户邮箱
    public  static final String  EMAIL="email";
    //用户名
    public  static final String  USERNAME="username";
    //用户角色
    public interface Role{
        int ROLE_CUSTOMER = 0; //普通用户
        int ROLE_ADMIN = 1;//管理员
    }
    //购物车
    public interface  Cart{
        int CHECKED=1;//购物车选中状态
        int UN_CHECKED=0;//未选中
        String LIMIT_NUM_FAIL="LIMIT_NUM_FAIL";
        String LIMIT_NUM_SUCCESS="LIMIT_NUM_SUCCESS";
    }
    //商品的排序
    public interface  ProductListOrderBy{
        Set<String>  PRICE_ASC_DESC= Sets.newHashSet("price_desc","price_asc");
    }
    //商品的在线状态
    public enum ProductStatusEnum{
        ON_SALE(1,"在线");
        private  String value;
        private int code;

        ProductStatusEnum(int code, String value) {
            this.value = value;
            this.code = code;
        }

        public String getValue() {
            return value;
        }

        public int getCode() {
            return code;
        }
    }
}
